package cn.wen.javax.net.mail;

import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Title：邮件消息对象
 * <p>
 * Description：描述与设置 邮件消息，包括：发送者，接收者，抄送，暗送，发送时间，标题，内容，附件等。
 * <p>
 * Copyright：Copyright (c) 2010-2012
 * 
 * @author <a href="mailto:ct_wen@qq.com">ctwen</a>, 温承瑭
 * @version Revision：1.0 Date：2012/8/2 Description：初完成。
 *          <p>
 */
public class MailMessage implements IMailMessage {

    /**
     * 发送者
     */
    protected String from;

    /**
     * 回复到
     */
    protected List<String> replyTo = new ArrayList<String>();

    /**
     * 接收者
     */
    protected List<String> to = new ArrayList<String>();

    /**
     * 抄送者
     */
    protected List<String> cc = new ArrayList<String>();

    /**
     * 暗送者
     */
    protected List<String> bcc = new ArrayList<String>();

    /**
     * 发送时间
     */
    protected Date sentDate;

    /**
     * 标题
     */
    protected String subject;

    /**
     * 内容
     */
    protected String text;

    /**
     * 附件
     */
    protected List<File> attach = new ArrayList<File>();

    @Override
    public String getFrom() {
	return from;
    }

    public void setFrom(String from) {
	this.from = from;
    }

    @Override
    public List<String> getReplyTo() {
	return replyTo;
    }

    public void addReplyTo(String replyTo) {
	this.replyTo.add(replyTo);
    }

    public void setReplyTo(List<String> replyTo) {
	this.replyTo = replyTo;
    }

    @Override
    public List<String> getTo() {
	return to;
    }

    public void addTo(String to) {
	this.to.add(to);
    }

    public void setTo(List<String> to) {
	this.to = to;
    }

    @Override
    public List<String> getCc() {
	return cc;
    }

    public void addCc(String cc) {
	this.cc.add(cc);
    }

    public void setCc(List<String> cc) {
	this.cc = cc;
    }

    @Override
    public List<String> getBcc() {
	return bcc;
    }

    public void addBcc(String bcc) {
	this.bcc.add(bcc);
    }

    public void setBcc(List<String> bcc) {
	this.bcc = bcc;
    }

    @Override
    public Date getSentDate() {
	return sentDate;
    }

    public void setSentDate(Date sentDate) {
	this.sentDate = sentDate;
    }

    @Override
    public String getSubject() {
	return subject;
    }

    public void setSubject(String subject) {
	this.subject = subject;
    }

    @Override
    public String getText() {
	return text;
    }

    public void setText(String text) {
	this.text = text;
    }

    @Override
    public List<File> getAttach() {
	return attach;
    }

    public void addAttach(String pathname) {
	addAttach(new File(pathname));
    }

    public void addAttach(File attchment) {
	this.attach.add(attchment);
    }

    public void setAttach(List<File> attach) {
	this.attach = attach;
    }

}
